<template>
  <div class="v-number">
    <i class="iconfont icon-remove_circle_outline" @click="handleClickPlus"></i>
    <input type="text" v-model="number" @keyup='handleInputNumber' />//这里好像有点冲突
    <i class="iconfont icon-add_circle" @click="handleClickMin"></i>
  </div>
</template>
<script>
import { parse } from 'path';
export default {
  name: "vnumber",
  data() {
    return {
      number: 0
    };
  },
  methods: {
    handleClickPlus() {
      this.number--;
    },
    handleClickMin() {
      this.number++;
    },
    handleInputNumber(){
        this.number = parseInt(this.number)||0
    }
  }
};
</script>
<style lang='less' scoped>
.v-number {
  display: flex;
  justify-content: center;
  align-items: center;
  input {
    width: 0.5rem;
    border: 0;
    text-align: center;
    line-height: 0.3rem;
  }
  .iconfont {
    color: lightblue;
    width: 0.3rem;
    height: 0.3rem;
  }
}
</style>